package com.kuangstudy.controller.blog;

import com.kuangstudy.entity.BlogCategory;
import com.kuangstudy.service.blogcategory.IBlogCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangfushuai
 * @description 文章分类数据
 * @since 2022/4/17 18:17
 **/
@RestController
public class BlogCategoryController {

    @Autowired
    private IBlogCategoryService blogCategoryService;

    /**
     * @author zhangfushuai
     * @description 异步加载分类数据
     * @since 2022/4/17 18:21
     * 参数
     * @return java.util.List<com.kuangstudy.entity.BlogCategory>
     **/
    @GetMapping("/api/blogcategory/load")
    public List<BlogCategory> findCategories() {
        return blogCategoryService.findBlogCategies();
    }

}
